package com.acegear.horizon.domain.models.jpa;

import com.acegear.horizon.domain.models.jpa.convert.ContentPartConverter;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * Created by wangsike on 2017/1/9.
 */
@Entity
@EntityListeners(AuditingEntityListener.class)
public class ClubEventInfo {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@Column(unique = true)
	private Long eventId;

	@Column(columnDefinition = "TEXT")
	@Convert(converter = ContentPartConverter.class)
	private List<ContentPart> introduction;

	@CreatedDate
	@Column
	private Long createAt;

	@LastModifiedDate
	@Column
	private Long updateAt;

	public ClubEventInfo() {
	}

	public ClubEventInfo(Long eventId, List<ContentPart> introduction) {
		this.eventId = eventId;
		this.introduction = introduction;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getEventId() {
		return eventId;
	}

	public void setEventId(Long eventId) {
		this.eventId = eventId;
	}

	public List<ContentPart> getIntroduction() {
		return introduction;
	}

	public void setIntroduction(List<ContentPart> introduction) {
		this.introduction = introduction;
	}

	public Long getCreateAt() {
		return createAt;
	}

	public void setCreateAt(Long createAt) {
		this.createAt = createAt;
	}

	public Long getUpdateAt() {
		return updateAt;
	}

	public void setUpdateAt(Long updateAt) {
		this.updateAt = updateAt;
	}
}
